/*
 *PlayerStatistics class will handle all the statistics that we want to keep track of.
 *
*/


#include "player_statistics.h"

using namespace std;

/*
 *variables
 *   //offensive stats
 *
 *   int atBats;
 *   int singles;
 *   int doubles;
 *   int triples;
 *   int homeruns;
 *   int walks;
 *   int strikeouts;
 *   int runsScored;
 *   int runsBattedIn;
 *   int stolenBases;
 *   int gamesPlayed;
 *
 *   //pitching stats
 *
 *   int walksPitched;
 *   int earnedRuns;
 *   double inningsPitched;
 *   int gamesPitched;
 *   int strikeoutsPitched;
 *   int wins;
 *   int losses;
 *   int hitsAllowed;
 *   int atBatsFaced;
 *
 *   //defensive stats
 *   int errors
*/
PlayerStatistics::PlayerStatistics()
{
    //load stats from sqlite database
}

//offensive stat methods
int PlayerStatistics::getAtBats(){
    return atBats;
}

void PlayerStatistics::setAtBats(int inputAtBats){
    atBats=inputAtBats;
}

int PlayerStatistics::getSingles(){
    return singles;
}

void PlayerStatistics::setSingles(int inputSingles){
    singles=inputSingles;
}

int PlayerStatistics::getDoubles(){
    return doubles;
}

void PlayerStatistics::setDoubles(int inputDoubles){
    doubles=inputDoubles;
}

int PlayerStatistics::getTriples(){
    return triples;
}

void PlayerStatistics::setTriples(int inputTriples){
    triples=inputTriples;
}

int PlayerStatistics::getHomeRuns(){
    return homeruns;
}

void PlayerStatistics::setHomeRuns(int inputHomeruns){
    homeruns=inputHomeruns;
}

int PlayerStatistics::getHits(){
    return singles+doubles+triples+homeruns;
}

double PlayerStatistics::getBattingAverage(){
    return getHits()/atBats;
}

double PlayerStatistics::getOnBasePercentage(){
    return getHits()/(atBats+sacrificeFlys);
}

int PlayerStatistics::getRunsScored(){
    return runsScored;
}

void PlayerStatistics::setRunsScored(int inputRunsScored){
    runsScored=inputRunsScored;
}

int PlayerStatistics::getRunsBattedIn(){
    return runsBattedIn;
}

void PlayerStatistics::setRunsBattedIn(int inputRunsBattedIn){
    runsBattedIn=inputRunsBattedIn;
}

int PlayerStatistics::getStolenBases(){
    return stolenBases;
}

void PlayerStatistics::setStolenBases(int inputStolenBases){
    stolenBases=inputStolenBases;
}

int PlayerStatistics::getGamesPlayed(){
    return gamesPlayed;
}

void PlayerStatistics::setGamesPlayed(int inputGamesPlayed){
    gamesPlayed=inputGamesPlayed;
}

//pitching stats
int PlayerStatistics::getWalksPitched(){
    return walksPitched;
}

void PlayerStatistics::setWalksPitched(int inputWalksPitched){
    walksPitched=inputWalksPitched;
}

int PlayerStatistics::getEarnedRuns(){
    return earnedRuns;
}

void PlayerStatistics::setEarnedRuns(int inputEarnedRuns){
    earnedRuns=inputEarnedRuns;
}

double PlayerStatistics::getInningsPitched(){
    return inningsPitched;
}

void PlayerStatistics::setInningsPitched(double inputInningsPitched){
    inningsPitched=inputInningsPitched;
}

double PlayerStatistics::getEarnedRunAverage(){
    return (earnedRuns*9)/inningsPitched;
}

int PlayerStatistics::getGamesPitched(){
    return gamesPitched;
}

void PlayerStatistics::setGamesPitched(int inputGamesPitched){
    gamesPitched=inputGamesPitched;
}

int PlayerStatistics::getStrikeoutsPitched(){
    return strikeoutsPitched;
}

void PlayerStatistics::setStrikeoutsPitched(int inputStrikeoutsPitched){
    strikeoutsPitched=inputStrikeoutsPitched;
}

int PlayerStatistics::getWins(){
    return wins;
}

void PlayerStatistics::setWins(int inputWins){
    wins=inputWins;
}

int PlayerStatistics::getLosses(){
    return losses;
}

void PlayerStatistics::setLosses(int inputLosses){
    losses=inputLosses;
}

int PlayerStatistics::getHitsAllowed(){
    return hitsAllowed;
}

void PlayerStatistics::setHitsAllowed(int inputHitsAllowed){
    hitsAllowed=inputHitsAllowed;
}

int PlayerStatistics::getAtBatsFaced(){
    return atBatsFaced;
}

void PlayerStatistics::setAtBatsFaced(int inputAtBatsFaced){
    atBatsFaced=inputAtBatsFaced;
}

double PlayerStatistics::getOpponentsBattingAverage(){
    return hitsAllowed/atBatsFaced;
}

int PlayerStatistics::getErrors(){
    return errors;
}

void PlayerStatistics::setErrors(int inputErrors){
    errors=inputErrors;
}

